<?php defined('RUN_KATANA') or die('Restricted access'); ?>
<?php 
if(is_object($adc->getCurrentAd())): 


	switch(get_class($adc->getCurrentAd()))
	{
		case 'AdVehicle':
		case 'AdVehicleLight':
			$itemscope = 'Vehicle';
		break;
		default:
			$itemscope = 'Product';
		break;
	}
?>
	<div class="prospector detail prospect" itemscope itemtype="http://schema.org/<?php echo $itemscope; ?>">
    	<div class="row-fluid row prospectbar fixed">
            <div class="span8 col-md-8 hidden-print">
            	<div class="back pull-left visible-phone visible-sm">
            		<a class="btn btn-small btn-default" href="#" onclick="window.history.go(-1);" title="<?php echo ucfirst($txt->getWord('back')); ?>"><i class="icon-arrow-left"></i></a>&nbsp;&nbsp;
                </div>
            	<?php require($adc->getViewPath().'elements/LikeTools.php'); ?>&nbsp;
                <a class="btn btn-small" href="?print=1" target="_blank" title="<?php echo ucfirst($txt->getWord('print')); ?>"><i class="icon-print"></i></a>
            </div>
            <div class="span4 col-md-4 col-print-12">
            	<div class="row-fluid">
                	<p class="span6 col-md-6 small"><?php echo $katana->getTitle().' '.ucfirst($txt->getWord('code')); ?>: <?php echo $adc->getCurrentAd()->getId(); ?></p>
                    <p class="span6 col-md-6 small"><?php echo ucfirst($txt->getWord('last_modified')); ?>: <?php echo $adc->getCurrentAd()->getDateModified('d.m.Y'); ?></p>
                </div>
            </div>
        </div><hr />
        <h2 class="title" itemprop="name"><?php echo $adc->getCurrentAd()->getMetaTitle(); ?></h2>
    	<div class="<?php if(!($_REQUEST['print'])): ?>row-fluid row<?php endif; ?>">
            <div class="<?php if(!($_REQUEST['print'])): ?>span8 col-md-8<?php endif; ?> info">
                <div class="info-padding">
                    <?php require($adc->getViewPath().'elements/Images.php'); ?>
                    <hr />
                    <?php /* <h2 class="summary"><?php echo $adc->getCurrentAd()->getSummary(); ?></h2>
                    <hr /> */?>
                    <div>
                        <?php 
						$okIcon = '';
						if($theme->getIconSetPrefix() == 'fa fa')
						{ $okIcon = '<i class="'.$theme->getIconSetPrefix().'-check-square fa-lg"></i>'; }
						else
						{ $okIcon = '<i class="'.$theme->getIconSetPrefix().'-ok icon-large"></i>'; }
						
                        if(is_file($adc->getViewPath().get_class($adc->getCurrentAd()).'.php'))
                        { require($adc->getViewPath().get_class($adc->getCurrentAd()).'.php'); }
                        ?>
                        <h3><?php echo ucfirst($txt->getWord('description')); ?></h3>
                        <p itemprop="description"><?php echo str_replace("\r\n", '<br />', $adc->getCurrentAd()->getDescription()); ?></p>
                        <?php if(($adc->CurrentAd->getProductLink() != '') || ($adc->CurrentAd->getProductLink2() != '')): ?><hr />
                        <p class="red">
                            <strong>
                                <?php if(($adc->CurrentAd->getProductLink() != '') && ($adc->CurrentAd->getProductLink2() != '')): ?>
                                    <?php echo ucfirst($txt->getWord('product_links')); ?> : <br />
                                <?php else:  ?>
                                    <?php echo ucfirst($txt->getWord('product_link')); ?> : 
                                <?php endif;  ?>
                                <?php if($adc->CurrentAd->getProductLink() != ''): ?>
                                 - <a href="<?php echo $adc->CurrentAd->getProductLink(); ?>" target="_blank"><?php 
                                    if($adc->CurrentAd->getProductLinkTxt() != '')
                                    { echo $adc->CurrentAd->getProductLinkTxt(); }
                                    else
                                    { echo ucfirst($txt->getWord('more_info').' '.$txt->getWord('click_here')); }
                                ?></a>
                                <?php endif;  ?>
                                <?php if($adc->CurrentAd->getProductLink2() != ''): ?><br />
                                 - <a href="<?php echo $adc->CurrentAd->getProductLink2(); ?>" target="_blank"><?php 
                                    if($adc->CurrentAd->getProductLinkTxt2() != '')
                                    { echo $adc->CurrentAd->getProductLinkTxt2(); }
                                    else
                                    { echo ucfirst($txt->getWord('more_info').' '.$txt->getWord('click_here')); }
                                ?></a>
                                <?php endif;  ?>
                            </strong>
                        </p>
                        <?php endif;  ?>
                    </div>
                    <hr />
                    <?php require($adc->getViewPath().'elements/Files.php'); ?>
                    <?php if(!($_REQUEST['print'] != '')): ?>
                    <?php require($adc->getViewPath().'elements/EditTools.php'); ?>
                    <?php endif; ?>
                </div><!-- End info-padding -->
                <div class="visible-desktop">
                    <?php if(!($_REQUEST['print'] != '')): ?>
                    <?php require($adc->getViewPath().'elements/UserAds.php'); ?>
                    <?php endif; ?>
                </div><!-- End visible-desktop -->
			</div><!-- End info -->
            <div class="<?php if(!($_REQUEST['print'])): ?> span4 col-md-4 <?php endif; ?> seller-info" <?php if($_REQUEST['print'] != '') { echo 'style="clear:both;"'; }?>>
                <div class="seller-info-padding">
                    <?php require($adc->getViewPath().'elements/Contact.php'); ?>
                    <br /><hr />
                    <?php require($adc->getViewPath().'elements/Location.php'); ?>
                    <div class="v-space">&nbsp;</div><hr />
                    <?php if(!($_REQUEST['print'] != '')): ?>
                    <?php require($adc->getViewPath().'elements/TellFriend.php'); ?>
                    <?php endif; ?>
                    <script type="text/javascript">
                        $("fieldset.com_form").hover( function ()  { jQuery('input#stealth').val('<?php echo md5(date("m-d-w")); ?>'); } );
                    </script>
                    <div class="v-space clear">&nbsp;</div>
                    <?php if(!($_REQUEST['print'] != '')): ?>
                    <?php 
                    if(is_file(TEMPLATES_PATH.'sites/'.$katana->getId().'/layout/objects/banners/bannerAdDetail.php'))
                    { require(TEMPLATES_PATH.'sites/'.$katana->getId().'/layout/objects/banners/bannerAdDetail.php'); }
                    ?>
                    <?php endif; ?>
                    <div class="clear">&nbsp;</div>
                </div>
            </div>
        </div>
	</div>
<?php 
	if($user->getId() != $adc->CurrentAd->getUserId())
	{
		$katana->TrackViews['am_ads'][$adc->CurrentAd->getId()]['table'] = 'am_ads';
		$katana->TrackViews['am_ads'][$adc->CurrentAd->getId()]['where'] = 'id='.$adc->CurrentAd->getId();
		$katana->TrackViews['am_ads'][$adc->CurrentAd->getId()]['set'] = 'ViewsDetail=ViewsDetail+1';
	}
endif;
?>
